import * as Cesium from 'cesium/Cesium';
import 'cesium/Widgets/widgets.css';

import Earth from "../../src/earth/Earth";

/**
 * 初始化Earth控件
 * @param {*} earthContainer 
 * @returns 
 */
export function createEarth(earthContainer){
    let earth = new Earth(earthContainer);
    return earth;
}

/**
 * 初始化Earth控件，自定义skybox
 * @param {*} earthContainer 
 * @returns 
 */
export function createEarthWithSkybox(earthContainer){
    let earth = new Earth('cesiumContainer',{
        skyBox : new Cesium.SkyBox({
            sources : {
              positiveX : 'skybox/starmap/starmap_2020_16k_px.jpg',
              negativeX : 'skybox/starmap/starmap_2020_16k_mx.jpg',
              positiveY : 'skybox/starmap/starmap_2020_16k_py.jpg',
              negativeY : 'skybox/starmap/starmap_2020_16k_my.jpg',
              positiveZ : 'skybox/starmap/starmap_2020_16k_pz.jpg',
              negativeZ : 'skybox/starmap/starmap_2020_16k_mz.jpg'
            }
        })
    });
    return earth;
}
